﻿<Window x:Class="Weather.Windows.WeatherMetro"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:Weather.Controls"
        xmlns:Properties="clr-namespace:Weather.Properties"
        xmlns:WeatherIcons="clr-namespace:Weather.WeatherIcons"
        Height="450" Width="320" WindowStyle="None" ResizeMode="NoResize" AllowsTransparency="True" Background="Transparent" FontWeight="Light"
        SourceInitialized="WindowSourceInitialized" Loaded="WindowLoaded" MouseMove="WindowMouseMove" MouseLeftButtonUp="WindowMouseLeftButtonUp" MouseEnter="ThisMouseEnter"
        MouseLeave="ThisMouseLeave">
    <Window.ContextMenu>
        <ContextMenu>
            <MenuItem Header="Demo" Visibility="Collapsed">
                <MenuItem Name="ClearItem" Header="Clear" Click="ClearItem_Click"/>
            </MenuItem>
            <MenuItem Name="RefreshItem" Header="{x:Static Properties:Resources.Refresh}" Click="RefreshItemClick"/>
            <Separator />
            <MenuItem Name="PinItem" Header="{x:Static Properties:Resources.Pin}" IsCheckable="True" Click="PinItemClick"/>
            <MenuItem Name="TopMostItem" Header="{x:Static Properties:Resources.TopMost}" IsCheckable="True" Click="TopMostItemClick"/>
            <MenuItem Name="OptionsItem" Header="{x:Static Properties:Resources.OptionsItem}" Click="OptionsItemClick"/>
            <MenuItem Name="CloseItem" Header="{x:Static Properties:Resources.CloseItem}" Click="CloseItemClick"/>
        </ContextMenu>
    </Window.ContextMenu>
    <Window.RenderTransform>
        <ScaleTransform x:Name="Scale" ScaleX="1" ScaleY="{Binding ElementName=Scale, Path=ScaleX}"/>
    </Window.RenderTransform>
    <Window.TaskbarItemInfo>
        <TaskbarItemInfo x:Name="Taskbar"/>
    </Window.TaskbarItemInfo>
    <Window.Resources>
        <Storyboard x:Key="MouseEnter">
            <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.3" FillBehavior="Stop" Completed="MouseEnterCompleted"/>
        </Storyboard>
        <Storyboard x:Key="MouseLeave">
            <DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:0.3" FillBehavior="Stop" Completed="MouseLeaveCompleted"/>
        </Storyboard>
    </Window.Resources>
    <Grid Margin="10,45,10,10">
        <Image Source="/Weather;component/Resources/shadow.png" Margin="-6" Stretch="Fill"/>
        <Rectangle RadiusX="10" RadiusY="10" Stroke="#717171" Opacity="0.7" Fill="#CC000000"/>
        <Border ClipToBounds="True" CornerRadius="10,10,0,0" Margin="1,1,1,145">
            <Border.Background>
                <VisualBrush>
                    <VisualBrush.Visual>
                        <MediaElement Name="MediaElement" LoadedBehavior="Manual" Stretch="Fill" Opacity="0" MediaEnded="MediaElementMediaEnded"/>
                    </VisualBrush.Visual>
                </VisualBrush>
            </Border.Background>
        </Border>
        <StackPanel Name="HLTempGrid" VerticalAlignment="Top" Margin="0,5,10,0" HorizontalAlignment="Right" Orientation="Vertical">
            <StackPanel.Effect>
                <DropShadowEffect Direction="315" ShadowDepth="1" BlurRadius="2"/>
            </StackPanel.Effect>
            <TextBlock Name="TemperatureHTextBlock" Text="0°" Foreground="White" FontSize="20" HorizontalAlignment="Right"/>
            <TextBlock Name="TemperatureLTextBlock" Text="0°" Foreground="White" FontSize="20" HorizontalAlignment="Right"/>
        </StackPanel>
        <StackPanel Name="HWGrid" VerticalAlignment="Top" Margin="0,60,10,0" HorizontalAlignment="Right" Visibility="Collapsed">
            <StackPanel Name="WindSpeedPanel" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,0,0">
                <Image Name="WindSpeedIcon" Source="/UIFramework.Weather;Component/Images/wind_lvl1.png" Width="42" Height="36" Margin="0,-10,-1,0" RenderOptions.BitmapScalingMode="HighQuality" Stretch="Fill"/>
                <TextBlock Name="WindSpeedValueTextBlock" Foreground="White" Text="25 mph" FontSize="16">
                        <TextBlock.Effect>
                            <DropShadowEffect Direction="315" ShadowDepth="1" BlurRadius="2" />
                        </TextBlock.Effect>
                </TextBlock>
            </StackPanel>
            <StackPanel Name="HumidityPanel" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,-8,0,0">
                <Image Name="HumidityIcon" Source="/UIFramework.Weather;Component/Images/humidity_lvl1.png" Width="16" Height="16" Margin="0,-10,3,-10" RenderOptions.BitmapScalingMode="HighQuality"/>
                <TextBlock Name="HumidityValueTextBlock" Foreground="White" Text="75%" FontSize="16">
                        <TextBlock.Effect>
                            <DropShadowEffect Direction="315" ShadowDepth="1" BlurRadius="2" />
                        </TextBlock.Effect>
                </TextBlock>
            </StackPanel>
        </StackPanel>
        <Image Name="WeatherIcon" Source="/UIFramework.Weather;Component/Images/weather_1.png" VerticalAlignment="Top" Margin="0,-70,0,0" Width="250"/>
        <TextBlock Name="TemperatureTextBlock" Text="26°" Foreground="White" FontSize="166" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,-40,0,0">
            <TextBlock.Effect>
                <DropShadowEffect BlurRadius="3" ShadowDepth="2" />
            </TextBlock.Effect>
        </TextBlock>
        <Grid Visibility="Collapsed">
            <WeatherIcons:SomeClouds x:Name="SomeClouds"  VerticalAlignment="Top" Margin="0,-90,0,0" Width="250"/>
            <WeatherIcons:Sun x:Name="Sun" VerticalAlignment="Top" Margin="0,-90,0,0" Width="250" MouseLeftButtonDown="SunMouseLeftButtonDown" MouseRightButtonDown="SunMouseRightButtonDown" />
        </Grid>
        <TextBlock Name="SetupLocationTextBlock" Text="{x:Static Properties:Resources.SetupLocation}" VerticalAlignment="Center" HorizontalAlignment="Center" TextWrapping="Wrap" Foreground="White" FontSize="24" Margin="10,-100,10,0" Visibility="Collapsed">
           <TextBlock.Effect>
              <DropShadowEffect Direction="315" ShadowDepth="1" BlurRadius="2"/>
           </TextBlock.Effect>
        </TextBlock>
        <StackPanel Name="WeatherGrid" VerticalAlignment="Bottom" Margin="0,0,0,160">
            <TextBlock Name="LocationTextBlock" Text="New York" Foreground="White" FontSize="22" HorizontalAlignment="Center">
                <TextBlock.Effect>
                    <DropShadowEffect Direction="315" ShadowDepth="1" BlurRadius="2"/>
                </TextBlock.Effect>
            </TextBlock>
            <TextBlock Name="WeatherTextBlock" Text="Clear" Foreground="White" FontSize="18" HorizontalAlignment="Center" MaxWidth="280" TextTrimming="CharacterEllipsis">
                <TextBlock.Effect>
                    <DropShadowEffect Direction="315" ShadowDepth="1" BlurRadius="2" Opacity="0.5"/>
                </TextBlock.Effect>
            </TextBlock>
        </StackPanel>
        <ProgressBar Name="WeatherRefreshProgressBar" Height="30" VerticalAlignment="Bottom" IsIndeterminate="True" Style="{StaticResource WeatherRefreshProgressBarStyle}" Foreground="White" Visibility="Collapsed" Margin="0,0,0,17"/>
        <Grid Name="ForecastGrid" Height="135" VerticalAlignment="Bottom" Margin="3,0,3,20" SnapsToDevicePixels="True">
            <Grid Name="ForecastPanel">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Controls:ForecastItemMetro Cursor="Hand"/>
                <Controls:ForecastItemMetro Grid.Column="1" Cursor="Hand"/>
                <Controls:ForecastItemMetro Grid.Column="2" Cursor="Hand"/>
                <Controls:ForecastItemMetro Grid.Column="3" Cursor="Hand"/>
            </Grid>
        </Grid>
        <!--<Image Source="/Resources/footer.png" VerticalAlignment="Bottom" Opacity="0.5"/>-->
        <Border Name="Footer" CornerRadius="0,0,10,10" VerticalAlignment="Bottom" Height="18">
            <Border.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" Opacity="0.5">
                    <GradientStop Color="#bdbdbd" Offset="0"/>
                    <GradientStop Color="#6f6f6f" Offset="0.5"/>
                    <GradientStop Color="#525252" Offset="0.5"/>
                    <GradientStop Color="#4c4c4c" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>
            <StackPanel>
                <Rectangle Fill="#4d4d4d" Height="1" Opacity="0.85"/>
                <Rectangle Fill="#9a9a9a" Height="1" Opacity="0.7"/>
            </StackPanel>
        </Border>
    </Grid>
</Window>
